<template>
  <div class="page-index l-main">
    <ArticleList :list="articleList" />
  </div>
</template>

<script>
export default {
  name: 'MainPage',
  data() {
    return {};
  },
  async asyncData({ $client }) {
    const pageSize = 10;
    let articleList = [];
    try {
      const result = await $client.post.list();
      const { data } = result;
      articleList = data.content;
    } catch (err) {
      console.log(err);
    }
    return {
      pageSize,
      articleList,
    };
  },
};
</script>
